In networking applications, it is useful to be able to access data in using structures, for example as described in an article entitled “C Preprocessor Trick For Implementing Similar Data Types” by Lars Wirzenius dated 17 Jan. 2000, is available on the Internet at liw#iki#fi%liw%texts%cpp-trick#html (wherein “/” is replaced with “%” and wherein “.” is replaced with “#”, in order to comply with USPTO rule to avoid browser-executable code). This article is incorporated by reference herein in its entirety.
However, the support for structures provided in assembly language of a network processor is either non-existent or if present is likely to be very limited. For example, the NASM assembler does not support structures. However, NASM preprocessor is powerful enough to implement data structures using a set of macros (e.g. macros STRUC and ENDSTRUC may be used to define a structure data type) as described in Chapter 5 of a book entitled “ECE Computer Engineering II, January 2003 Laboratory Notes The ECE 291 Documentation Project” published by Department of Electrical and Computer Engineering University of Illinois at Urbana-Champaign, and Edited by Peter L. B. Johnson and available on the Internet at courses#ece#uiuc#edu%ece291%books%labmanual%index#html (wherein “/” is replaced with “%” and wherein “.” is replaced with “#”). This reference is also incorporated by reference herein in its entirety.
In contrast, high level languages such as C provide support for handling a group of variables together using a common name, and accessing each variable individually using the “.” operator. Pascal supports a similar construct which is known as a record. Note that the term “structure” as used in the C language should not be confused with the more generic term “data structure” which refers to any grouping of information such as an array or a linked list. Normally, every structure that is defined is given a name, and the variables that the structure contains (called members as per the C language) are also given names.
C language structures are easy to use. For example, you can assign one structure to another structure of the same type. In the C language, a union is like a structure in which all of the members are stored at the same address.
Although easy to use, the C language structures using the “.” operator are not (to the inventor's knowledge) supported by an assembler for a network processor. Consequently, the effort required to prepare software (in assembly language) for execution by such network processors is significant.